package com.hjms.tenant.services;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.hjms.tenant.contracts.IEmployeeService;
import com.hjms.tenant.domain.Employee;
import com.hjms.tenant.repository.EmployeeMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @author 何杨谊
 * @description: TODO
 * @date 2023/1/4 23:46
 */
@Service
public class EmployeeService implements IEmployeeService {
    @Resource
    private EmployeeMapper employeeMapper;

    @Override
    public boolean CheckLoginNameIsExist(String loginName) {
        int count = employeeMapper.selectCount(
                new QueryWrapper<Employee>()
                        .eq("login_name", loginName)
        );
        return count > 0;
    }
}
